<?php 
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
defined('_JEXEC') or die('Restricted access'); 

$user =& JFactory::getUser();

//Ordering allowed ?
$lists = $this->lists;
$rows = $this->rows;
$page = $this->pageNav;
JHTML::_('behavior.tooltip');

?>
<form action="index.php" method="post" name="adminForm" class="content-right">

<input type="hidden" name="filter_order" value="<?php echo $lists['filter_order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $lists['filter_order_Dir']; ?>" />
	
	<table class="adminlist">
		<thead>
			<tr>
				<th width="2%" align="left">
					<?php echo JText::_( 'NUM' ); ?>
				</th>			
				<th width="1%">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows);?>);" />
				</th>					
				<th width="15%">
					<?php echo JHTML::_('grid.sort',   'Title', 'd.alias', @$lists['filter_order_Dir'], @$lists['filter_order'] ); ?>
				</th>	
				<th width="5%">
					<?php echo JHTML::_('grid.sort',   'ENABLE', 'd.published', @$lists['filter_order_Dir'], @$lists['filter_order'] ); ?>
				</th>																
				<th width="10%" align="left">
					<?php echo JHTML::_('grid.sort',   'NAME', 'd.name', @$lists['filter_order_Dir'], @$lists['filter_order'] ); ?>
				</th>
				<th width="10%" align="left">
					<?php echo JHTML::_('grid.sort',   'ID', 'd.id', @$lists['filter_order_Dir'], @$lists['filter_order'] ); ?>
				</th>
			</tr>
		</thead>	
		<tfoot>
			<tr>
				<td colspan="7">
					<?php echo $page->getListFooter(); ?>
				</td>
			</tr>
		</tfoot>
		<tbody>
		<?php
		
		$k = 0;
		for ($i=0, $n=count( $rows ); $i < $n; $i++)
		{
			$row = $rows[$i];
			$row->checked_out = 1;
            $checked 		= JHTML::_('grid.checkedout',   $row, $i);		
			JFilterOutput::objectHtmlSafe($row);
			if (!$row->error)
				$published 	= JHTML::_('grid.published', $row, $i );
			else 	
				$published = '<font color="Red">'.JText::_('File not found').'</font>';
			$link = 'index.php?option=com_jajobboard&view=japaymentconfig&task=edit&pay='. $row->name;
			?>
			<tr class="<?php echo "row$k"; ?>">
					<td>
						 <?php echo $page->getRowOffset( $i ); ?>
					</td>			
					<td width="1%" align="center">
						<?php echo $checked; ?>
					</td>
					<td align="left">
						<?php if (!$row->error) { ?>
							<a href="<?php echo $link;?>"><?php echo $row->alias;?></a>
						<?php } else {
							echo $row->alias;
						 } ?>
					</td>
					
					<td align="center">
						<?php echo $published;?>
					</td>	
					
					<td align="center">
						<?php echo $row->name;?>
					</td>		
					<td align="center">
						<?php echo $row->id;?>
					</td>																	
					<?php
					$k = 1 - $k;
					?>					
				</tr>
			<?php
			$k = 1 - $k; ?>
			<?php if ($row->error) { ?>
			<tr>
				<td colspan="6">
					<img src="<?php echo JURI::base().'components/com_jajobboard/images/warning.png'; ?>"  alt="<?php echo JText::_('Warning !'); ?>"/>
					<?php echo JText::_("Your payment file ")."<b>'".$row->name.".php'</b>".JText::_(" is not exist now.").'<br />'.JText::_("You can download this file from "); ?>
					<a target="_blank" href="http://www.joomlart.com/forums/downloads.php?do=file&id=865">http://www.joomlart.com/forums/downloads.php?do=file&id=865</a>.
					<?php echo JText::_("Then copy to ").JPATH_COMPONENT_SITE.DS.'assets'.DS.'payments'; ?>
					
				</td>
			</tr>
			<?php } ?>
		<?php
		}
		?>
		</tbody>					
	</table>

<input type="hidden" name="option" value="com_jajobboard" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="view" value="japaymentconfig" />
</form>